<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>组件</title>
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<!-- 组件：传递给组件中的值-->
			<dzh v-for="item in items" v-bind:comp="item"></dzh>
		</div>
		
		
		<script>
			//定义一个vue组件component
			Vue.component("dzh",{
				props:['comp'],
				template:'<li>{{comp}}</li>'
				
			})
			
			var vm = new Vue({
				el:"#app",
				data:{
					items:["java","Linux","前端"]
				}
			})
		</script>
	</body>

</html>
